home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10125 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  38 lines

  1. Newsgroups: comp.lang.c
  2. Path: sword.eng.pyramid.com!pyrltd!markb
  3. From: markb@pyramid.com (Mark Bluemel)
  4. Subject: Re: Tradition or what?
  5. Message-ID: <1996Mar15.163722.6685@pyra.co.uk>
  6. Sender: news@pyra.co.uk
  7. Organization: Pyramid Technology Ltd.
  8. X-Newsreader: TIN [version 1.2 PL2]
  9. References: <4g0elg$mdr@redstone.interpath.net> <4hpd8a$d70@alterdial.UU.NET> <1996Mar8.153250.115645@kuhub.cc.ukans.edu> <4hqfug$19l@news.interpath.net> <4hqkso$gno@news1.mnsinc.com>
  10. Date: Fri, 15 Mar 1996 16:37:22 GMT
  11.  
  12. Szu-Wen Huang (huang@mnsinc.com) wrote:
  13. : Scott McMahan - Softbase Systems (softbase@mercury.interpath.net) wrote:
  14. : : anh@kuhub.cc.ukans.edu wrote:
  15. : : : Well, I found one good use of magic numbers such as when one needs a 
  16. : : : localized temporary buffer of data.
  17. : : : Well, if I know the data is always going to be less than 15 or whatever, 
  18. : : : there is really no need to use a #define here.
  19.  
  20. : : You defeated your own argument!
  21.  
  22. : : Suppose you "know" that your buffer is "always" going to be 80
  23. : : bytes. Then it changes to 132!
  24.  
  25. : Let me join in.  I use magic numbers for states in parsing tables,
  26. : and will shoot anybody who suggests I should #define state numbers.
  27. : I hope we buried the issue, now that I've given one good place to
  28. : use magic numbers instead of #define's.
  29.  
  30. May I respectfully suggest that #defines would be clearer and enumerations
  31. clearer still ?
  32.  
  33. --
  34. Mark Bluemel    Unix/Oracle Trainer and Consultant
  35.         My opinions are my own, but I'll share them
  36.         All solutions to problems are offered "as is"
  37.         and without warranty - you have been warned :-)
  38.